import { lifeCycle } from '../render-helpers'

export default {
  props: ['lifeCycle'],
  created() {
    const { lifeCycleParams = [], lifeCycleSource } = this.$options
    const params = lifeCycleParams.reduce((pre, cur) => (this[cur] && pre.push(this[cur]), pre), [])
    lifeCycle(this[lifeCycleSource], ...params)
  }
}
